ZFS Canned Reports Notes



Data Base Description:

The canned reports for ZFS obtains all information in a Sybase database residing on a server.
There are 3 tables that the canned reports use:
1. POLICIES
2. POLICYACTION
3. SERVERS

The following describes each table and its columns (fields)

SERVERS
-------

SERVERS_SERVID - not sure where this comes from
SERERNAME - the short name of the server as seen on the console prompt
SERVERDN - the DS distinguished name of the server (a dotted string?)
REVERSEDN - the same as above but in reverse oder and '\' delimited
OSNAME - the name of the OS (NetWare 5.00)
OSVERSION - the version of the OS (4.11, 5.0)
TREENAME - the DS tree the server is belongs to

There is one row for each server.

POLICIES
--------

POLICYID - a globally unique ID?
POLICYDN - the DS distinguished name of the policy
POLICYPACKAGE - the DS DN of the policy package the policy belongs to
POLICYCLASS - the class of the policy (sometimes called 'type')
              these are only defined in the NDS schema and the valid string
			  values are:

				ZFS:Server Downing Policy
				ZFS:Schedule Down Policy
				ZFS:Set Server Param Policy
				ZFS:Server Script Policy
				ZFS:Text File Policy
				ZFS:Scheduled Run Policy
				ZFS:ZFS Policy
				ZFS:Community Policy
				ZEN:SNMP Trap Target Policy
				ZEN:SMTP Host Policy
				ZEN:Database Location Policy

POLICYTREENAME - the DS tree the policy belongs to

There is one row for each policy / policypackage combination.

POLICYACTION
------------

POLICYACTION_POLICYID - associated this entry with an entry in the 
                        policy table
SERVERID - associates this action with a server in the server table
CREATIONDATE - time stamp of the action
DESCRIPTION - undefined string describing an error
CODE - the result code of the action the following are valid values:


			RC_POL_SUCCESS          = 0;
			RC_POL_PARTIAL_SUCCESS  = 1;
			RC_POL_FAILURE          = -1;
			RC_POL_EMTPY            = -2;


			EXCEPTION!!! if the ACTIONCODE (see below) is
			AC_POL_DOWN_CONNECTIONS  or	AC_POL_DOWN_DISCONNECTIONS
			then the value of CODE is either the current number of
			active connections or the number of forced disconnects.

			(Question: How is a '1' interpreted?)


ACTIONCODE - the action being performed the following are valid
             values:



			AC_POL_DISCOVERED          = 101
			AC_POL_SCHEDULED           = 102
			AC_POL_APPLIED             = 103
			AC_POL_APPLIED_CHANGE      = 104
			AC_POL_NO_ENFORCER         = 105
			AC_POL_DOWN_CONNECTIONS    = 106
			AC_POL_DOWN_DISCONNECTIONS = 107
			AC_POL_DOWN_UNLOAD         = 108
			AC_POL_DOWN_EMAIL          = 109
			AC_POL_DOWN_NOTIFY         = 110
			AC_POL_DOWN_CANCELED       = 111
			AC_POL_DOWN_IGNORED        = 112
			AC_POL_DOWN_REQUESTED      = 113


There is one row for every action performed.

Prerequesites:

1. ODBC driver on client for SYBASE. - I got mine by installing ZEN 2.0
2. SYBASE database engine on server. - I installed ZEN 2.0

The following are "WELL KNOWN" defintions:

1. The database name used to configure the ODBC driver is: servernamezeninv
2. The database file name is zeninv.
3. The user name is DBA and the password is sql.
4. The port number is 2638



Known Bugs:

Once the .cat file has been modified by ConsoleOne the JReport Workbench
will not open the file.

There is no way to associate reports with queries in the Workbench catalog window.

The edit box in the Workbench will deleted text if you type beyond the boundaries
or resize smaller than existing test.

Date Format - the date format is not syntax checked for runtime queries.  Also it is
unclear exactly what in acceptable.
According to the Workbench the following is valid:
	M/d/yy
	dd-MMM-yy
	MMMM d, yyyy
	EEEE, MMMM d, yyyy

This was obtained by adding a parameter to a report of type date and 
getting an error by entering a -1 for the date. Note: (ConsoleOne
does NOT support the use of parameters). I have no idea what EEEE is.



How to build:

The Reports for ZFS were created using the JReport Workbench.  
The page layout and SQL querys are stored in three types of files.
There is a .cls file for each report and one each of .fml and .cat file.
These files are used by ConsoleOne to generate reports.



Installation:

It is important to note that these files MUST be stored in a dir
that has the same name as the .cat file.

These files need to be installed with ConsoleOne in the following dir:

ConsoleOne\1.2\reporting\canned\Novell Reporting\ZFS Reports\en

Once a context is selected ConsoleOne allows the installation
of the reports on the server of your choice.  Once installed ConsoleOne
allows the addition of "run time" queries to the report.  It is critical to 
understand that the reports on server define HOW the report will look,
NOT where the data comes from.  That data will come from where the
ODBC driver has been configured to access.  (If ZEN 2.0 is installed
there are NAL application objects created to ease this configuration)





There are 5 canned reports available.

1. Discovered Policies Report:

This report displays all discovered policies in the database.  A policy is 
said to be discovered if its ACTIONCODE = 101 AND its CODE = 0.

The report is grouped by Policy Package DN and then by Policy DN and is sorted by 
SERVERNAME.

2. Successful Policies Report:

This report displays all suddesful policies in the database.  A policy is 
said to be sucessful if its CODE = 0.

The report is grouped by Policy Package DN and then by Policy DN and is sorted by 
SERVERNAME.

3. Unenforcable Policies Report:

This report displays all unenforced policies in the database.  A policy is 
said to be unenforcable if its ACTIONCODE = 105.

The report is grouped by Policy Package DN and then by Policy DN and is sorted by 
SERVERNAME.

4. Failed Policies Report:

This report displays all discovered policies in the database.  A policy is 
said to be discovered if its CODE != 0 AND ACTIONCODE != 106 or 107.

The report is grouped by Policy Package DN and then by Policy DN and is sorted by 
SERVERNAME.

5. Down Policies Report:

This report displays all Down policies in the database.  A policy is 
said to be a down policy if its POLICYCLASS = "ZFS:Server Downing Policy".

The report is grouped by Policy DN and is sorted by SERVERNAME.



Software package database schema



PACKAGES

  PACKAGEGUID (primary key)
  PACKAGENAME
  PACKAGEDESC
  PACKAGEVERSION
  BUILDDATE

PACKAGEACTION

  PACKAGAGEACTIONID (primary key)
  PACKAGEGUID
  SERVERID
  CREATION DATE
  DESCRIPTION
  CODE is Success =0 /Fail = 1/Partial = 2 with Policy Package actions
  ACTIONCODE is AC_PACKAGE_INSTALL      = 0/AC_PACKAGE_ROLLBACK     = 1/AC_PACKAGE_INSTALL_STARTED = 2/AC_PACKAGE_ROLLBACK_STARTED = 3


SOFTWARECOMPONENTACTION

  ACTIONCODE is AC_COMPONENT_STARTED = 200
  CODE
  CREATIONDATE
  DESCRIPTION
  NAME
  PACKAGEACTIONID (points to a PACKAGEACTION)

